/* Create an AST, then invoke our interpreter. */

import miniJava.lexer.*;
import miniJava.node.*;

import java.io.*;

public class Main {
	public static void main(String[] args) {
		if (args.length > 0) {
			try {
				/* Form our AST */
				Lexer lexer = new Lexer(
						new PushbackReader(
								new FileReader(
										"C:\\Users\\Joao Luiz\\workspace\\" +
										"mc011\\Compilador MC011\\testes\\small\\1\\11"),
								1024));
				Token token = lexer.next();
				while (!token.getText().equals("")) {
					if (!token.getClass().equals(TTokBlank.class)) {
						System.out.print(token.getClass().toString().substring(
								24, token.getClass().toString().length())
								+ " ");
					}

					if (token.getText().contains("\r\n")
							|| token.getClass().equals(TTokComment.class)) {
						System.out.println();
					}
					token = lexer.next();
				}

				// Parser parser = new Parser(lexer);
				// Start ast = parser.parse() ;
				// 
				// /* Get our Interpreter going. */
				// Interpreter interp = new Interpreter () ;
				// ast.apply(interp) ;
			} catch (Exception e) {
				System.out.println(e);
			}
		} else {
			System.err.println("usage: java miniJava inputFile");
			System.exit(1);
		}
	}
}
